1. Field of the Invention
The present invention relates to a photoelectric switch, and more specifically relates to improvement in photoelectric switch that receives a reflected light from a detection area to perform workpiece determination.
2. Description of Related Art
A photoelectric switch is a detector for detecting a workpiece by use of a light. The photoelectric switch projects a detected light, and receives a light reflected by or a light transmitted through a workpiece, or some other light, to perform workpiece determination. Based on the result of the workpiece determination, the photoelectric switch generates a detection signal. Types of the photoelectric switch include: a light receiving amount-type photoelectric switch that performs workpiece determination by use of a light receiving amount of a reflected light or a transmitted light from a detection area including a workpiece; a distance measurement-type photoelectric switch that performs workpiece determination by measuring a distance to the workpiece, and a color discrimination-type photoelectric switch that performs workpiece determination by discriminating a color of the workpiece surface.
The light receiving amount-type photoelectric switch performs workpiece discrimination through use of variation in light receiving amount due to a difference in reflectance or color of the workpiece surface, a difference in distance to the workpiece, a difference in tilt (tilt angle) of the workpiece surface, or the like. This is a general-purpose photoelectric switch applicable to a large number of uses.
Meanwhile, the distance measurement-type photoelectric switch measures a characteristic in accordance with the shape of the workpiece as a distance to the workpiece, to perform the workpiece determination. This is less susceptible to variation in reflectance and color of the workpiece surface and variation in tilt (tilt angle) of the workpiece surface. Further, the color discrimination-type photoelectric switch performs the workpiece determination by use of the color of the workpiece surface. This is less susceptible to variation in reflectance of the workpiece surface, variation in distance to the workpiece, and variation in tilt (tilt angle) of the workpiece surface.
A conventional color discrimination-type photoelectric switch is provided with three light emitting elements for respectively generating red, green, and blue detected lights, and one light receiving element for receiving a reflected light to generate a light reception signal (e.g., Unexamined Japanese Patent Publication No. 2000-121440, Unexamined Japanese Patent Publication No. 2000-121441, Unexamined Japanese Patent Publication No. 2005-127869, and Unexamined Japanese Patent Publication No. 2005-291748). In this sort of photoelectric switch, based on light receiving amount levels Rk, Gk, Bk of the three colors, obtained by sequentially turning on the respective light emitting elements in a time-division manner, a color is represented by a ratio of the light receiving amount levels of the three colors: rk=Rk/Mk, gk=Gk/Mk, bk=Bk/Mk (a sum of the light receiving amounts: Mk=Rk+Gk+Bk). It is then determined whether or not a ratio r1, g1, b1 of the light receiving amount levels, acquired at the time of the workpiece determination, is coincident with a ratio r0, g0, b0 of the light receiving amount levels of a previously registered reference color. Specifically, the ratio of the light receiving amount levels of each color is compared with the ratio of the light receiving amount levels of the reference color, to obtain a coincidence degree of the two pieces of color information. This coincidence degree is compared with a threshold for determination, to perform the workpiece determination.
The light receiving amount level of the reference color is defined based on the light receiving amount level of each color acquired at the timing instructed by the user. For example, based on a plurality of light receiving amount levels acquired within a predetermined period or on a ratio of the light receiving amount levels, the maximum value and the minimum value are obtained for each color component, and a median value of the maximum value and the minimum value is specified as the light receiving amount level, or the ratio of the light receiving amount levels, of the reference color.
The conventional photoelectric switch described above uses the coincidence degree for the color discrimination to represent color information, which is normally represented by three parameters, by one parameter as the coincidence degree. Hence this photoelectric switch can be handled in a similar manner to the light receiving amount-type photoelectric switch that performs color discrimination by use of a light receiving amount and a threshold, and the setting can be simply made. Meanwhile, in the case of detecting a label pasted on the workpiece, a component assembled to the workpiece, or the like, the conventional photoelectric switch obtains a color difference from the reference color, and determines that the label or the assembled component exists when the color difference is not lower than a certain level. Also in the case of detecting a register mark representing a cut position of a sheet-like member, a label pasted position, or the like, it is determined that the register mark exists when the color difference from the reference color is not lower than a certain level. The color difference is obtained from the coincidence degree and its upper limit. When color information is completely coincident with the reference color, the color difference is 0.
In the conventional photoelectric switch, as described above, a color difference from a previously registered reference color is compared with a threshold for determination, to discriminate the presence or absence of a label or the like. Thus, when color combination of the workpiece surface has changed from color combination at the time of registering the reference color, the detection accuracy deteriorates, which has been problematic. For example, the color combination of the workpiece surface changes due to color fade-out or variation among manufacturing lots. Further, the color combination of the workpiece surface changes due to attachment of contamination. Moreover, it is considered that, when a distance to the workpiece varies due to flapping or waving of a carrier device, the color combination changes by an influence of chromatic aberration of an optical system. Such a change in color combination undesirably leads to occurrence of erroneous detection.